/*
* Poppy Game Engine - https://pgetemplate.googlecode.com/svn/
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* Copyright (c) 2008 Poppy
*/

#include "stdafx.h"
#include <malloc.h>
#include "CMemObject.h"

namespace PGESystem
{

	#ifdef PGE_MEMORY_DEBUG
	void * CMemObject::operator new(size_t size, const char * file, int line, const char * function)
	{
		return malloc(size);
	}

	void * CMemObject::operator new[](size_t size, const char * file, int line, const char * function)
	{
		return malloc(size);
	}

	void CMemObject::operator delete(void * pointer, const char * file, int line, const char * function)
	{
		free(pointer);
	}

	void CMemObject::operator delete[](void * pointer, const char * file, int line, const char * function)
	{
		free(pointer);
	}
	#else

	void * CMemObject::operator new(size_t size)
	{
		return malloc(size);
	}

	void * CMemObject::operator new[](size_t size)
	{
		return malloc(size);
	}
	#endif

	void CMemObject::operator delete(void * pointer)
	{
		free(pointer);
	}

	void CMemObject::operator delete[](void * pointer)
	{
		free(pointer);
	}

}
